package com.xiaotu.service.sync;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.xiaotu.dao.mysql.MysqlTitan5WeekMapper;
import com.xiaotu.dao.pgsql.PgsqlTitan5WeekMapper;
import com.xiaotu.entity.CityColumn0;
import com.xiaotu.service.redission.Pg2MysqlRedisService;
import io.netty.util.internal.UnstableApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author zhangxiao
 * @create 2022-03-03 10:48
 */
@Service
@Transactional
public class Pg2MsqlTitan5WeekService {

    private static Integer pageCount = 5000;

    @Autowired
    private PgsqlTitan5WeekMapper pgsqlTitan5WeekMapper;

    @Autowired
    private MysqlTitan5WeekMapper mysqlTitan5WeekMapper;

    @Autowired
    private Pg2MysqlRedisService pg2MysqlRedisService;

    private String tab_city_column_0 = "tab_city_column_0";

    public List<String> getGroupDateList(){
        List<String> list = pgsqlTitan5WeekMapper.getGroupDateList();
        return list;
    }

    public void batInsertList(String idate) {
        List<CityColumn0> cityColumn0s = pgsqlTitan5WeekMapper.selectList(idate);
        mysqlTitan5WeekMapper.batchInsert(cityColumn0s);
    }

}
